﻿@model Productos_Electrodomesticos.Controllers.ProductoForm

@{
    ViewBag.Title = "Crear";
    Layout = "~/Views/Shared/_AdministracionLayout.cshtml";
}

<h2>Crear</h2>

@using (Html.BeginForm(
    null, null, FormMethod.Post, new { enctype = "multipart/form-data" }
    ))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Producto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Modelo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Modelo)
            @Html.ValidationMessageFor(model => model.Modelo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Precio)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Precio)
            @Html.ValidationMessageFor(model => model.Precio)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Descripcion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descripcion)
            @Html.ValidationMessageFor(model => model.Descripcion)
        </div>
         <p>Foto</p>
        <div class="editor-field">
           <input type="file" name="archivo" id="archivo" />

           @* @Html.EditorFor(model => model.Foto)
            @Html.ValidationMessageFor(model => model.Foto)*@
        </div>
        <legend>Marca</legend>

        <select id="Marca_id" name="Marca_id">
           @using (var db = new Productos_Electrodomesticos.Models.ContProductos()) {
               foreach (var mar in db.Marcas) {
                   <option value="@mar.Id">@mar.Nombre</option>
               }
         }
       </select>

        <p>
            <input type="submit" value="Agregar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver a la lista", "Index")
</div>

